package com.sigmazero13.MKDummy.utils;

import android.content.Context;
import android.content.SharedPreferences;

import com.sigmazero13.MKDummy.components.CardDisplayIconCountView;
import com.sigmazero13.MKDummy.components.CardDisplayIconRemainingView;
import com.sigmazero13.MKDummy.components.CardDisplayTextCountView;
import com.sigmazero13.MKDummy.components.CardDisplayTextRemainingView;
import com.sigmazero13.MKDummy.components.CardDisplayView;

public class CardDisplayViewFactory {

	public static CardDisplayView createCardDisplayView(SharedPreferences p, Context c) {
		boolean showColors = p.getBoolean("show_card_colors", true);
		boolean showIcons = p.getBoolean("show_icons", true);
		
		if (showColors) {
			if (showIcons) {
				return new CardDisplayIconCountView(c);
			} else {
				return new CardDisplayTextCountView(c);
			}
		} else {
			if (showIcons) {
				return new CardDisplayIconRemainingView(c);
			} else {
				return new CardDisplayTextRemainingView(c);
			}
		}
	}
}
